

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Device</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Device List</g:link></span>
        </div>
        <div class="body">
            <h1>Create Device</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${device}">
            <div class="errors">
                <g:renderErrors bean="${device}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="notifyEmail">Notify Email:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'notifyEmail','errors')}">
                                    <input type="text" id="notifyEmail" name="notifyEmail" value="${fieldValue(bean:device,field:'notifyEmail')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="notifyAction">Notify Action:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'notifyAction','errors')}">
                                    <g:select id="notifyAction" name="notifyAction" from="${device.constraints.notifyAction.inList.collect{it.encodeAsHTML()}}" value="${fieldValue(bean:device,field:'notifyAction')}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="allowNotify">Allow Notify:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'allowNotify','errors')}">
                                    <g:checkBox name="allowNotify" value="${device?.allowNotify}" ></g:checkBox>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="codeVersion">Code Version:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'codeVersion','errors')}">
                                    <input type="text" id="codeVersion" name="codeVersion" value="${fieldValue(bean:device,field:'codeVersion')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dateCreated">Date Created:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'dateCreated','errors')}">
                                    <g:datePicker name="dateCreated" value="${device?.dateCreated}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="devicegroup">Devicegroup:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'devicegroup','errors')}">
                                    <g:select optionKey="id" from="${Devicegroup.list()}" name="devicegroup.id" value="${device?.devicegroup?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="equipmentType">Equipment Type:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'equipmentType','errors')}">
                                    <input type="text" id="equipmentType" name="equipmentType" value="${fieldValue(bean:device,field:'equipmentType')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="featureSet">Feature Set:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'featureSet','errors')}">
                                    <input type="text" id="featureSet" name="featureSet" value="${fieldValue(bean:device,field:'featureSet')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="imeiNumber">Imei Number:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'imeiNumber','errors')}">
                                    <input type="text" id="imeiNumber" name="imeiNumber" value="${fieldValue(bean:device,field:'imeiNumber')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="isActive">Is Active:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'isActive','errors')}">
                                    <g:checkBox name="isActive" value="${device?.isActive}" ></g:checkBox>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lastInputState">Last Input State:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'lastInputState','errors')}">
                                    <input type="text" id="lastInputState" name="lastInputState" value="${fieldValue(bean:device,field:'lastInputState')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lastUpdated">Last Updated:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'lastUpdated','errors')}">
                                    <g:datePicker name="lastUpdated" value="${device?.lastUpdated}" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="notes">Notes:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'notes','errors')}">
                                    <input type="text" id="notes" name="notes" value="${fieldValue(bean:device,field:'notes')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="simPhoneNumber">Sim Phone Number:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:device,field:'simPhoneNumber','errors')}">
                                    <input type="text" id="simPhoneNumber" name="simPhoneNumber" value="${fieldValue(bean:device,field:'simPhoneNumber')}"/>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
